package com.zdb.personal.controller;


import com.zdb.personal.po.ZdbPmsUserPo;
import com.zdb.personal.service.ZdbPmsUserService;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 个人中心 controller
 */
@RestController
@RequestMapping("/user")
public class ZdbPmsUserController {

    //user 表的注入
    @Resource
    private ZdbPmsUserService zdbPmsUserService;



    /**
     * 根据id查询个人数据
     * @return 查询的数据
     */
    @RequestMapping(value = "/queryUserZdbPmsUser/{id}")
    public ZdbPmsUserPo queryUserZdbPmsUser(@PathVariable("id")int id){
        return this.zdbPmsUserService.getById(id);
    }


    /**
     * 更新数据
     * @param zdbPmsUserPo 传入实体
     * @return
     */
    @RequestMapping("/updataSite")
    public boolean updataSite(@RequestBody ZdbPmsUserPo zdbPmsUserPo){
        System.err.println(zdbPmsUserPo);
        return this.zdbPmsUserService.updateById(zdbPmsUserPo);
    }


}
